home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Auge 4000 / Auge 4000 #47 (1990-06-22)(Amiga User Gruppe Einzugsgebiet 4000).zip / Auge 4000 #47 (1990-06-22)(Amiga User Gruppe Einzugsgebiet 4000).adf / ARP-DOCS1.3 / If < prev    next >
Text File  |  1990-06-22  |  4KB  |  133 lines

  1.  
  2.  
  3.  
  4.      IF(V1.3)                ARP User's Manual                IF(V1.3)
  5.  
  6.  
  7.  
  8.      NAME
  9.           IF - Add intelligent branching to scripts.
  10.  
  11.      SYNOPSIS
  12.           IF NOT/s WARN/s ERROR/s FAIL/s EQ/k GT/k GE/k VAL/s EXISTS/k
  13.  
  14.      DESCRIPTION
  15.           If the condition tested by IF evaluates to TRUE, then the
  16.           commands immediately following the IF, up to the following
  17.           ELSE or ENDIF, are executed. If the condition tested by IF
  18.           evaluates to FALSE, it moves the execution of the file ahead
  19.           to the command following the next ELSE command (if there is
  20.           one), or to ENDIF, if there is no intervening ELSE.
  21.  
  22.      CONDITIONS
  23.           Each of the following will evaluate to true or false:
  24.  
  25.           WARN This will be true if the return code value set by the
  26.                last command is greater than or equal to 5.
  27.  
  28.           ERROR
  29.                This will be true if the return code value set by the
  30.                last command is greater than or equal to 10.
  31.  
  32.           FAIL This will be true if the return code value set by the
  33.                last command is greater than or equal to 20.  Note that
  34.                you will have to use a Failat command to raise the
  35.                default fail limit from 10 to above 20 if you wish to
  36.                use this test.
  37.  
  38.           EQ   This takes two arguments, and will be true if both
  39.                arguments are the same (i.e., EQUAL).  The default is a
  40.                string comparison, but see VAL, below.
  41.  
  42.           GE   Takes two arguments. This will be true if the first
  43.                argument is Greater than or Equal to the second
  44.                argument.  This may be combined with NOT (see below) to
  45.                perform a LT (less than) test. The default comparison
  46.                is a string compare, but see VAL, below.
  47.  
  48.           GT   Takes two arguments. This will be true if the first
  49.                argument is Greater than the second.  This may be
  50.                combined with NOT (see below) to construct a LE (less
  51.                than or equal to) test.  The default comparison is a
  52.                string compare, but see VAL, below.
  53.  
  54.           EXISTS
  55.                This takes one argument, which should be a device, file
  56.                or directory.  This will be TRUE if the device, file or
  57.                directory exists.
  58.  
  59.      MODIFIERS
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 4/28/89)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      IF(V1.3)                ARP User's Manual                IF(V1.3)
  71.  
  72.  
  73.  
  74.           The following options to IF modify the meaning of the above
  75.           tests:
  76.  
  77.           NOT  Inverts the sense of the test.  This is always used in
  78.                combination with another keyword. As an example, the
  79.                line: "If NOT EQ" will be TRUE if the EQ is false. This
  80.                modifier combines with any of the others.
  81.  
  82.           VAL  This affects the type of compare done by the EQ GT and
  83.                GE keywords. By default, the comparison is a string
  84.                compare.  However, if you specify this keyword, the
  85.                comparison performed is numeric.
  86.  
  87.      OTHER
  88.           The ARP Shell contains this command as a builtin, the only
  89.           difference between the two is that the Shell version can be
  90.           executed directly from the command line, while the diskbased
  91.           version cannot.
  92.  
  93.           Both versions support environment variable expansion.  The
  94.           shell always expands environment variables, and the
  95.           diskbased version does it internally.
  96.  
  97.      EXAMPLE
  98.           IF EXISTS ARP_DISK
  99.               Echo "An excellent decision!"
  100.           ELSE
  101.               Echo "Why not?"
  102.           ENDIF
  103.  
  104.      SEE ALSO
  105.           AshManual Execute
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 4/28/89)
  130.  
  131.  
  132.  
  133.